<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/10/28
 * Time: 11:49
 */
namespace core;

class bootstrap{
     public $assign=[];
     private static $filemap=[];
     public static function load($class){
           $file=str_replace('\\','/',$class);
           $file=$file.".php";
          if(isset(self::$filemap[$class]))
           {
                return true;
           }else{
               if(is_file($file)){
                   include $file;
                   self::$filemap[$class]=$class;
               }else{
                   return false;
               }
           }
     }


     public function assign($name,$value){
          $this->assign[$name]=$value;
     }
     public function display($file){
         foreach ($this->assign as $key =>$val){
                 $$key=$val;
         }
         $file="view/".$file.'.html';
         if(is_file($file)){
             include $file;
         }else{
             echo "找不到视图文件";
         }




     }

}